/**
 * 
 */
package com.geezdata.cps.ttk.domain.factory;

import java.util.Date;

import com.geezdata.cps.base.utils.BeanUtil;
import com.geezdata.cps.ttk.domain.domain.OpenUser;

public class OpenUserFactory {
	public static OpenUser newInstance(OpenUser request , OpenUser existexistSharer) {
		OpenUser openUser = BeanUtil.convert(request,OpenUser.class);
    	Date now = new Date();
    	if (existexistSharer == null) {
			openUser.setCreatedUser("system");
			openUser.setCreatedAt(now);
			openUser.setStatus(1);
    	} else {
			openUser.setOpenUserId(existexistSharer.getOpenUserId());
    	}
		openUser.setUpdatedUser("system");
		openUser.setUpdatedAt(now);
        return openUser;
    }
}
